package manifests

import (
	blindagev1alpha1 "git.blindage.org/21h/redis-operator/pkg/apis/blindage/v1alpha1"

	"k8s.io/api/policy/v1beta1"
	metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// GeneratePdbResource used to create PodDisruptionBudget resources
func GeneratePdbResource(cr *blindagev1alpha1.Redis, name string, pdbSpec v1beta1.PodDisruptionBudgetSpec) v1beta1.PodDisruptionBudget {

	pdb := v1beta1.PodDisruptionBudget{
		ObjectMeta: metav1.ObjectMeta{
			Name:      name,
			Namespace: cr.Namespace,
			Labels:    BaseLabels(cr),
		},
		Spec: pdbSpec,
	}
	return pdb

}
